package com.yiqi.zhiyuan.entity.enums;

import com.yiqi.zhiyuan.R;

/**
 * @author lijuwen
 * @email 1440919311@qq.com
 * @date 2017/11/6 11:00
 * @apiNote 发送验证码标识
 */

public enum MsgType {

    GGXX("公告消息", R.mipmap.ic_msg_notice,0),
    XTXX("系统提醒",  R.mipmap.ic_msg_system,1),
    XCXX("行程消息", R.mipmap.ic_msg_trip,2),
    SYXX("收益消息", R.mipmap.ic_msg_earnings,3);


    // 成员变量
    private String name;
    private int index;
    private int imgRes;

    // 构造方法
    private MsgType(String name, int imgRes, int index) {
        this.name = name;
        this.index = index;
        this.imgRes = imgRes;
    }

    // 普通方法
    public static String getName(int index) {
        for (MsgType c : MsgType.values()) {
            if (c.getIndex() == index) {
                return c.name;
            }
        }
        return null;
    }

    // 普通方法
    public static int getImgRes(int index) {
        for (MsgType c : MsgType.values()) {
            if (c.getIndex() == index) {
                return c.imgRes;
            }
        }
        return 0;
    }

    // get set 方法
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getIndex() {
        return index;
    }

    public void setIndex(int index) {
        this.index = index;
    }

}
